<template>
  <div class="flh_datakb">
    <div class="mainView">
      <div class="itemTab">
        <div @click="onTab(3011)" class="tab" :class="activeId === 3011 ? 'activeTab':''">昨天</div>
        <div @click="onTab(3007)" class="tab" :class="activeId === 3007 ? 'activeTab':''">本周</div>
        <div @click="onTab(3008)" class="tab" :class="activeId === 3008 ? 'activeTab':''">本月</div>
      </div>
      <heat-map v-model="mapData"></heat-map>
  </div>
  </div>
</template>

<script>
import heatMap from "@/components/flh/heatMap.vue";
import { GetFLHHeatData } from "@/api/flh/home";
export default {
  components: {
    heatMap
  },
  data() {
    return {
      activeId: 3008,
      mapData: []
    };
  },
  mounted() {
    this.fetchData();
  },
  methods: {
    onTab(val) {
      this.activeId = val;
      this.fetchData();
    },
    fetchData() {
      this.fetchLineData();
    },
    async fetchLineData() {
      var params = {
        cityId: 0,
        timeType: this.activeId
      };
      var res = await GetFLHHeatData(params);
      if (res.data.code === "0") {
        this.mapData = res.data.result;
      }
    }
  }
};
</script>

<style lang="scss" scoped>
@import "../../../../../styles/base/_parameters";
.colorRowTab {
  width: 40%;
  margin-top: 70px;
}
.itemTab {
  position: fixed;
  top: 20px;
  left: 50px;
  z-index: 2;
  width: 200px;
  background: #55eda7;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-radius: 20px;
  height: 50px;
  box-shadow: 0px 0px 10px #888888;
  .tab {
    text-align: center;
    width: 34%;
    line-height: 50px;
  }
  .activeTab {
    color: #55eda7;
    background: black;
  }
  .tab:nth-of-type(1),
  .activeTab {
    border-radius: 0;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
  }
  .tab:nth-of-type(2),
  .activeTab {
    border-radius: 0;
  }
  .tab:nth-of-type(3),
  .activeTab {
    border-radius: 0;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
  }
}
.flh_datakb {
  @include absoluteAllSides;
  overflow: hidden;
  .mainView {
    // @include absoluteAllSides(40, 40, 40, 100);
    .title {
      font-size: 48px;
      font-weight: bold;
    }
    .line {
      height: 60px;
    }
    .hot {
      width: 40%;
      text-align: center;
      .top {
        font-size: 30px;
        color: #55eda7;
      }
      .bot {
        display: flex;
        position: relative;
        align-items: center;
        justify-content: flex-start;
        color: #fff;
        img {
          width: 20px;
          height: 20px;
          margin-right: 10px;
        }
        img:nth-of-type(2) {
          margin-left: 20px;
        }
        span {
          color: #1ec1ff;
        }
        span:nth-of-type(2) {
          color: #fdc409;
        }
      }
      .mid {
        .midItem {
          position: absolute;
          right: 60%;
          top: 30%;
          bottom: 0;
          left: 0;
          .laochengList {
            position: absolute;
            left: 23%;
            top: 5.5%;
            text-align: left;
            @include din(24px);
            .titleTxt {
              color: #fff;
            }
            .item {
              display: flex;
              align-items: center;
              justify-content: flex-start;
              line-height: 20px;
              span {
                margin-top: 8px;
                color: #fdc409;
              }
            }
            .item:nth-of-type(2) {
              span {
                color: #1ec1ff;
              }
            }
          }
          .xigong {
            top: 17%;
            left: 3%;
          }
          .jianxi {
            top: 37%;
            left: 1%;
          }
          .chanhe {
            top: 11%;
            left: 84%;
          }
          .luolong {
            top: 75.5%;
            left: 71%;
          }
          img {
            width: 20px;
            height: 20px;
            margin-right: 10px;
          }
          img:nth-of-type(2) {
            margin-left: 20px;
          }
        }
      }
    }
    .dealCon {
      position: absolute;
      left: 46%;
      top: 13%;
      right: 0;
      .title {
        font-size: 30px;
        font-weight: normal;
      }
      .rowCell {
        display: flex;
        align-items: center;
        justify-content: space-around;
        .item {
          width: 100%;
          .titleRow {
            display: flex;
            align-items: center;
            font-size: 24px;
            margin-top: 35px;
            img {
              width: 20px;
              height: 20px;
              margin-right: 10px;
            }
          }
          .shopColor {
            color: #2be851;
          }
          .perColor {
            color: #1ec1ff;
          }
          .table {
            color: #fff;
            width: 349px;
            .top {
              display: flex;
              background: rgba(43, 232, 81, 0.1);
              color: #2be851;
              font-size: 20px;
              align-items: center;
              justify-content: space-around;
              padding: 8px 0;
              margin-top: 20px;
            }
            .topBlue {
              display: flex;
              background: rgba(30, 193, 255, 0.1);
              color: #1ec1ff;
              font-size: 20px;
              align-items: center;
              justify-content: space-around;
              padding: 8px 0;
              margin-top: 20px;
            }
            .row {
              display: flex;
              align-items: center;
              padding: 8px 0;
              font-size: 18px;
              flex: 1;
              margin-left: 27px;
              span {
                text-align: left;
              }
              span:nth-of-type(1) {
                width: 100px;
              }
              span:nth-of-type(2) {
                width: 116px;
              }
              span:nth-of-type(3) {
                width: 90px;
              }
            }
            .blue {
              span:nth-of-type(1) {
                width: 100px;
              }
              span:nth-of-type(2) {
                width: 98px;
              }
              span:nth-of-type(3) {
                width: 90px;
              }
            }
          }
        }
      }
    }
    .dealTrend {
      margin-top: 78px;
    }
    .subTitle {
      font-size: 30px;
      font-weight: normal;
    }
    .rightView {
      position: absolute;
      right: 300px;
      top: 200px;
      .title {
      }
    }
  }
}
</style>